//
// Created by root on 22-10-28.
//

#include "Parameters.h"

std::string IMAGE_TOPIC;
std::string IMU_TOPIC;
std::string FEATURE_TOPIC;
std::string FISHEYE_MASK;
std::string PREFIX;
std::string CAM_MODEL;
std::vector<std::string> CAM_NAMES;
double ACC_N, ACC_W;
double GYR_N, GYR_W;
Eigen::Vector3d G;
int ROW;
int COL;
int MAX_CNT;
int MIN_DIST;

int WINDOW_SIZE;
int FREQ;
double F_THRESHOLD;
int SHOW_TRACK;
int STEREO_TRACK;
int EQUALIZE;
bool PUB_THIS_FRAME;
int FOCAL_LENGTH;

void parametersInitialize() {
    std::cout<<"Initializing Parameters..."<<std::endl;
    cv::FileStorage fsetting("/home/lionliya/catkin_ws/src/vin_test/config/parameters.yaml",cv::FileStorage::READ);


    PREFIX=std::string(fsetting["prefix"]);
    CAM_MODEL= std::string(fsetting["camera_model"]);

    //topic
    IMAGE_TOPIC=std::string(fsetting["image_topic"]);
    FEATURE_TOPIC=std::string(fsetting["feature_topic"]);
    IMU_TOPIC=std::string(fsetting["imu_topic"]);

    ACC_N = fsetting["acc_n"];
    ACC_W = fsetting["acc_w"];
    GYR_N = fsetting["gyr_n"];
    GYR_W = fsetting["gyr_w"];


    MAX_CNT=int(fsetting["max_cnt"]);
    MIN_DIST=int(fsetting["min_dist"]);
    ROW = int(fsetting["image_height"]);
    COL = int(fsetting["image_width"]);
    FOCAL_LENGTH=460;
    fsetting.release();
}
